package com.chaofan.sell.exception;

import com.chaofan.sell.enums.Result;
import lombok.Getter;

/**
 * @author: Fairy
 * @date: 2021/9/7
 */
public class SellException extends RuntimeException {

    /**
     * 错误码
     */
    @Getter
    private final Integer code;

    public SellException(Result result) {
        super(result.getMsssage());

        this.code = result.getCode();

    }

    public SellException(Integer code, String message) {
        super(message);
        this.code = code;
    }
}
